<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Install_Default"  Title="CSK Installer"%>

<%@ Register Src="../Modules/ResultMessage.ascx" TagName="ResultMessage" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div id="centercontent">
        <table width="100%">
            <tr><td height="50"><img src="<%=Page.ResolveUrl("~/images/csklogo.gif")%>" alt="CommerceStarterKit" /></td></tr>
            <tr>
                <td>
                    <h4>Installer</h4>
                    Welcome to the Commerce Starter Kit! Before the application can run, you need to
                    install your store's database. If you get stuck, or need help, you can access
                    our <a href="Help.aspx">install help page</a>.<br />
                    
                    <br />
                    The most common errors associated with installing the database have to do with security.
                    Make sure that the login you use below has Execution rights on your DB. Most ISPs
                    grant this with the login they give you, so you should be OK if you are installing
                    the database remotely.<br />
                    <br />
                    If you are installing the site locally, you might want to review our <a href="Help.aspx">
                        help page</a> that will show you h<a href="Help.aspx">ow to setup permissions properly</a>
                    for integrated authentication using SQL 2005 Express. (this install page can't do
                    it for you).<br />
                    <br />
                    If you want to install the system yourself (for example if you only want to install
                    the CSK store and not the membership), all of the scripts are in the Install/InstallScripts
                    folder. When you are finished just update the Web.Config as needed.<br />
                    <br />
                    <uc1:ResultMessage ID="ResultMessage1" runat="server" />
                    <br />
                       <asp:Panel ID="pnlServer" runat="server">
                      <div class="sectionheader">Server Selection</div>
                      <table cellpadding="5">
                            <tr>
                                <td>Server Name</td>
                                <td style="width: 137px"><asp:TextBox ID="txtServer" runat="server" Text="localhost\SQLEXPRESS" Width="242px"></asp:TextBox><br />
                                    <em>This is the name or IP of the DB Server that you want to install the database into.
                                        SQLExpress will automatically install itself into the above location.</em></td>
                            </tr>
                            <tr>
                                <td>
                                    Use Trusted Connection</td>
                                <td>
                                    <asp:CheckBox ID="chkTrusted" runat="server" AutoPostBack="True" Checked="True" OnCheckedChanged="chkTrusted_CheckedChanged" />
                                    <br />
                                    <i>If you select "Use Trusted Connection", you need to grant the ASP worker process DB_OWNER privileges. 
                                    If you don't know how to do this, <a href="Help.aspx"> READ THIS FIRST</a> or your install 
                                    will fail.
                                    </i>
                                
                                </td>
                                
                            </tr>
                      </table>
                      <asp:Panel ID="pnlSqlMode" runat="server" Visible="false">
                      <table cellpadding="5">
                             <tr>
                                <td>Username</td>
                                <td style="width: 137px"><asp:TextBox ID="txtUsername"  runat="server" ></asp:TextBox></td>
                            </tr>
                            <tr>
                                <td style="height: 21px">Password</td>
                                <td style="width: 137px; height: 21px"><asp:TextBox ID="txtPassword"  runat="server" ></asp:TextBox></td>
                            </tr>
                       </table>
                       </asp:Panel>
                       <asp:Button ID="btnSetServer" runat="server" Text="Set Server" OnClick="btnSetServer_Click" />
                        <br />
                        <br />
                       </asp:Panel>
                       <asp:Panel ID="pnlDB" runat="server" Visible="false">
                        <div class="sectionheader">Database Selection</div>
                        <table cellpadding="5">
                            <tr>
                                <td>Select Database:</td>
                                <td style="width: 201px"><asp:DropDownList ID="ddlDB" runat="server"></asp:DropDownList></td>
                            </tr>
                            <tr><td colspan="2">--or--</td></tr>
                            <tr>
                                <td>Create a new one:</td>
                                <td style="width: 201px"> <asp:TextBox id="txtCreateDB" runat="server"></asp:TextBox><asp:Button ID="btnCreate" runat="server" Text="Create" OnClick="btnCreate_Click" /> </td>
                           
                            </tr>
                        </table>
                               
                        </asp:Panel>
                           
                        <br />
                        <asp:Panel ID="pnlInstall" runat="server" Visible="false">
                            <div class="sectionheader">Install</div>

                            <asp:Button ID="Button1" runat="server" Text="Install" OnClick="Button1_Click" />
                            
                       </asp:Panel>
                        <asp:Label ID="lblProgress" runat="server" Text=""></asp:Label>
            
            </td></tr>
        </table>
    </div>
    </form>
</body>
</html>
